
    <div style="width:100%;">

	<?php
	if( ! isset ($formName) )
		$formName = "adminForm";
	
		if ($this->items)
		{
	?>
		<table class="tablelist resumelist">
        	<thead>
				<tr>
					<td width="20" class="sectiontableheader">
						<?php echo JText::_( 'NUM' ); ?>
					</td>
					<td width="20" class="sectiontableheader">
					 	<input type="checkbox" name="toggle" value="" onclick="jalist_show_box_action(this, '<?php echo $formName;?>'); checkAlls(document.<?php echo $formName;?>, <?php echo count($this->items); ?>);" />
					 </td>
					<?php
                    for($i = 0, $n = count($this->fieldlist); $i < $n; $i++ ){
                    	$field = $this->fieldlist[$i];
                        if($field->is_sortable){
                            $header = JHTML::_('grid.sort',   $field->label, $field->sort_field_name, @$this->lists['order_Dir'], @$this->lists['order'] );
                        } else {
                            $header = $field->label;
                        }
                        ?>
                        <td  class="sectiontableheader">
                            <?php echo  JText::_($header); ?>
                        </td>
                        <?php
                    }
                    ?>
<!--                    <?php if (getCurrentUserType() == JBEMPLOYER_USER) { ?>
                    <td  class="sectiontableheader"><?php echo JText::_('Action'); ?></td>
                    <?php } ?>-->
                    
				</tr>
			</thead>
			<tfoot>
				<tr>
					<th colspan="<?php echo count($this->fieldlist) + 3; ?>" style="text-align:center;">
						<?php echo $this->pagination->getListFooter(); ?>
					</th>
				</tr>
			</tfoot>
			<tbody>
        	<?php
        	$items = $this->items;
        	$k = 0;
        	for($i = 0, $n = count($items); $i < $n; $i++){
        		$item = $items[$i];
        		JFilterOutput::objectHTMLSafe( $item );
        		$checked 	= JHTML::_('grid.checkedout',   $item, $i );
        		if ($i==0)
		      		$classname = 'first sectiontableentry'.($k+1);
		      	elseif ($i==$n-1)
		      		$classname = 'last sectiontableentry'.($k+1);
		      	else 
		      		$classname = 'sectiontableentry'.($k+1);
                
        		?>
        		<tr class="<?php echo $classname; ?>">
            		<td class="first" style="text-align:center !important;"><?php echo $this->pagination->getRowOffset($i); ?></td>
					<td class="first" style="text-align:center !important;" >
	        			<input title="<?php echo JText::_('Click here to view more resumes')?>" id="cb<?php echo $i?><?php echo $formName;?>" type="checkbox" onclick="isCheckedJob(document.<?php echo $formName;?>, this.checked); jalist_show_box_action(this, '<?php echo $formName;?>'); " value="<?php echo $item->id; ?>" name="cid[]"/>
	        		</td>
            		<?php
                    if(getCurrentUserType() == JBJOB_SEEKER_USER && $limited == 1){
                       $allowedtask = "edit";
                    } else {
                       $allowedtask = "view";
                    }
                    for($ii = 0, $nn = count($this->fieldlist); $ii < $nn; $ii++ ){
                    	$added_note = '';
	                	if (isset($this->item_notes[$item->id])&&($this->item_notes[$item->id]->user_id==$user->id)){
            				$added_note = '<span class="note"><img src="components/com_jajobboard/images/icons/jobs/note.png" alt="'.JText::_('Added Note!').'" title="'.JText::_('Added Note!').'"/>'.JText::_('Added Note').'</span>'  ;      			
	                	}
                    	$td_classname = '';
                    	if ($ii==$nn-1)
                    		$td_classname = 'class="last"';
                        $field = $this->fieldlist[$ii];
                        $field_name = $field->field_name;
                        //$nowrap = $field->no_wrap ? "nowrap":"";
                        
                        if($field->clean_format && $item->$field_name != ""){                        	
                        	// $text = JFilterOutput::cleanText($item->$field_name);
                        	$text = html_entity_decode($item->$field_name);
                        	$text = strip_tags($text);
                        	$item->$field_name = $text;
                        }                     
                        $text = $field->truncate_length?SmartTrim::trim($item->$field_name,0,$field->truncate_length):$item->$field_name;
	                		                	
	                	if ($field->field_type=='URL'&&!$field->linked)
	                	{
		                	if (substr($item->$field_name,0,7)!='http://')
		                		$value_link = 'http://'.$item->$field_name;
		                	else 
		                		$value_link = $item->$field_name;
		                	$text = '<a href="'.$value_link.'" target="_blank">'.$text.'</a>';
		                }	                	
	                	$width_column = ($field->column_width!=0)?"width=\"".$field->column_width."%\"":"";
                        $align="";
                        if($field->field_type == "boolean" ){
                            $align = "align='center'";
                            $text = $this->getToggleLink($field_name, $item);
                        }
                        if($field->linked){
                            ?>
                            <td <?php echo $align; ?> <?php //echo $nowrap; ?> <?php echo $width_column; ?> <?php echo $td_classname; ?>>
                                <?php 
                                	$alias = JFilterOutput::stringURLSafe($item->$field_name);
                                    if($ii==0 && getCurrentUserType() == JBEMPLOYER_USER){ // First field
                                        if ($this->check_stared($item->id))
                                    		echo $this->getToggleLink('is_starred', $item,true); 
                                    	else 
                                    		echo $this->getToggleLink('is_starred', $item,false);
                                    	
                                    }
                                    
                                ?>  
                                                             
                                <a href="<?php echo JRoute::_( 'index.php?option='. JBCOMNAME .'&view=jaresumes&layout=jaview&cid[]='.$item->id.'&alias='.$alias.'&Itemid='.$this->Itemid); ?>" title="Click here to view detail of <?php echo $item->$field_name; ?>">
                                <?php if ($field->is_bold) echo '<strong>'; ?>
                                	<?php echo $text; ?>
                                <?php if ($field->is_bold) echo '</strong>'; ?>
                                </a>	
                                <?php if( $ii+1 == $nn ) echo $added_note;?>							
                            </td>
                            <?php
                        } else {
                        	if( $field->field_type == "DATE_CAL" || $field->field_type == "DATE"){
                        		$format = $jbconfig['general']->get("format_date", "Y-m-d");
                        		$format = str_replace("%", "", $format);
                        		if( strpos($text, " ") !== false && $jbconfig['general']->get("posts_show_published_date", "1") == "0" )
		                    			$text = date($format, strtotime($text));
                        	}
                            ?>
                            <td <?php echo $align; ?> <?php //echo $nowrap; ?> <?php echo $width_column; ?> <?php echo $td_classname; ?>>
                            <?php if ($field->is_bold) echo '<strong>'; ?>
                                <?php echo  $text; ?>
                            <?php if ($field->is_bold) echo '</strong>'; ?>
                            <?php if( $ii+1 == $nn ) echo $added_note;?>
                            </td>
                            <?php
                        }
                    }
                    ?>
            	</tr>
            	
        	<?php
        		$k = 1 - $k;
			}
        	?>
        	</tbody>
        	
		</table>
	<?php
		}
		else 
		{
			echo JText::_('not have any items');
	?>
		<br /><br />
		<a class="button" href="javascript:window.history.go(-1);"><?php echo JText::_('Back'); ?></a>	
	<?php
		}
	?>
	</div>
	<div id="ja-box-action" class="sectiontableheader">
		<div class="jalist-count">
			<?php echo JText::_('You have selected')?> <span id="count-selection">0</span> <?php echo JText::_('items')?>
		</div>
		<div class="jalist-actions-right">
			<ul>
				<li>
					<img title="<?php echo JText::_('View detail'); ?>" src="<?php echo JURI::base().'components/com_jajobboard/images/Preview-16x16.png' ?>" alt="<?php echo JText::_('View detail'); ?>" />
					&nbsp;
					<a href="javascript:submitbutton('multi_view','<?php echo count($this->items); ?>')">
						<span style="vertical-align: top !important;"><?php echo JText::_('View detail'); ?></span>
					</a>
				</li>
				
				<?php if(getCurrentUserType() == JBEMPLOYER_USER) {?>
				<li>
		     		<img title="<?php echo JText::_('Favorite'); ?>" src="<?php echo JURI::base().'components/com_jajobboard/images/Favorites-16x16.png' ?>" alt="<?php echo JText::_('Favorite'); ?>" />
		     		&nbsp;
					<a href="javascript:submitbutton('multi_starred','<?php echo count($this->items); ?>')">
						<span style="vertical-align: top !important;"><?php echo JText::_('Favorite'); ?></span>
					</a>
				</li>
				<?php } ?>
			</ul>
		</div>
	</div>